package com.FH.login;

import com.FH.util.ResultDTO;

import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;

/**
 * Created by Administrator on 2017/1/13.
 */
@Path("/loginpor")
@Produces(MediaType.APPLICATION_JSON)
@RequestScoped
public class LoginResource {

    @EJB
    private LoginDAO loginDAO;

    @GET
    @Path("/{member_name}&{member_password}&{orgId}")
    public ResultDTO getLoginInfo(@PathParam("member_name") String member_name, @PathParam("member_password") String member_password,@PathParam("orgId") String orgId)throws Exception{

        return  loginDAO.getLoginInfo(member_name,member_password,orgId);
    }
    @GET
    @Path("org/{member_name}")
    public ResultDTO georgInfo(@PathParam("member_name") String member_name)throws Exception{

        return  loginDAO.georgInfo(member_name);
    }

    /**
     * OA
     * @return
     * @throws Exception
     */
    @PUT
    @Path("/updateoa")
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO updateOALoginInfo()throws Exception{

        return loginDAO.updateOALoginInfo();
    }
    /**
     * OA
     * @return
     * @throws Exception
     */
    @PUT
    @Path("/updatetiku")
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO updateTiKuLoginInfo()throws Exception{

        return loginDAO.updateTiKuLoginInfo();
    }
        /**
     * OA
     * @return
     * @throws Exception
     */
    @PUT
    @Path("/updateceping")
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO updateCePingLoginInfo()throws Exception{

        return loginDAO.updateCePingLoginInfo();
    }
        /**
     * OA
     * @return
     * @throws Exception
     */
    @PUT
    @Path("/updatebase")
    @Consumes(MediaType.APPLICATION_JSON)
    public ResultDTO updateBaseLoginInfo()throws Exception{

        return loginDAO.updateBaseLoginInfo();
    }

}
